When working with Power BI, a common requirement is to track how many records (e.g., support tickets, orders, projects) are created and closed over time. A well-structured timeline dashboard helps monitor trends and identify bottlenecks in workflows.
In this post, we’ll explore two different approaches to building this type of report, explaining their pros and cons so you can choose the best method for your data.
Approach 1: Using a Separate Table for Closed Records
How It Works
This method involves splitting the dataset into two tables:
- Main Table (Records Table): Contains all records with both a Creation Date and, if applicable, a Closure Date.
- Filtered Table for Closed Records: A separate table including only records that have a Closure Date (if needed).
Steps to Implement
Create a Calendar Table that spans the relevant date range.
Set up relationships:
- Connect the Calendar Table to the Records Table [Creation Date].
- Connect the Calendar Table to the Closed Records Table [Closure Date].
Create DAX measures:
Count of Created Records
Records Created = COUNTROWS(FILTER(RecordsTable, NOT(ISBLANK(RecordsTable[CreationDate]))))Count of Closed Records
Records Closed = COUNTROWS(FILTER(ClosedRecords, NOT(ISBLANK(ClosedRecords[ClosureDate]))))
Build the visualization:
- Use a line chart, placing the Calendar[Date] on the X-axis.
- Add the Records Created and Records Closed measures to the Y-axis.
Pros & Cons
| ✅ Pros | ❌ Cons |
|---|---|
| Simple to implement | Requires creating an extra table |
| Performance is good for medium datasets | Can introduce redundancy in the data model |
| Relationships are straightforward | Not ideal for large datasets with frequent updates |
Approach 2: Using a Single Table with USERELATIONSHIP
How It Works
Instead of creating a separate table, this approach keeps everything in one dataset and establishes two relationships between the Calendar Table and the Records Table:
- Active relationship with
Creation Date. - Inactive relationship with
Closure Date, activated dynamically usingUSERELATIONSHIPin DAX.
Steps to Implement
Create a Calendar Table.
Set up relationships:
- Active:
Calendar[Date]→RecordsTable[CreationDate] - Inactive:
Calendar[Date]→RecordsTable[ClosureDate]
- Active:
Create DAX measures:
Count of Created Records
Records Created = COUNTROWS(FILTER(RecordsTable, NOT(ISBLANK(RecordsTable[CreationDate]))))Count of Closed Records (Activating the inactive relationship)
Records Closed = CALCULATE( COUNTROWS(RecordsTable), NOT(ISBLANK(RecordsTable[ClosureDate])), USERELATIONSHIP(Calendar[Date], RecordsTable[ClosureDate]) )
Build the visualization:
- Use a line chart with
Calendar[Date]as the X-axis. - Add the Records Created and Records Closed measures to the Y-axis.
- Use a line chart with
Pros & Cons
| ✅ Pros | ❌ Cons |
|---|---|
| No need for a separate table | USERELATIONSHIP can slow down large datasets |
| Cleaner data model | More advanced DAX, harder to debug |
| Works well with date-based filtering | Not ideal for very complex models with multiple date fields |
Which Approach Should You Use?
| Scenario | Best Approach |
|---|---|
| Small/Medium dataset, simple model | Separate Closed Records Table |
| Large dataset, need to reduce redundancy | Single Table with USERELATIONSHIP |
| Need for easy relationships & maintenance | Separate Closed Records Table |
| Need more flexibility & less duplication | Single Table with USERELATIONSHIP |
Final Thoughts
Both approaches are valid, and the choice depends on your dataset size, model complexity, and performance needs.
- If you prefer simplicity, go with the Separate Closed Records Table approach.
- If you want a cleaner model, use USERELATIONSHIP but be mindful of performance.
Which method do you prefer? Let me know in the comments! 🚀